<?php echo $this->Html->script('tinymce/tinymce.min');?>

<div class="col-lg-12">
	<div class="portlet">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-plus"></i><?= isset($this->data[$als]['id']) ? 'Sửa' : 'Thêm mới'; ?>
        </div>
    </div>

	<div class="portlet-body form">
		<?php echo $this->Form->create($als, array('class' => 'form-horizontal form-bordered', 'type' => 'file'));?>
		<?php echo $this->Form->hidden($als.'.id' )?>
		<div class="portlet-body">
			<div class="form-body">
				<div class="form-group">
					<label class="col-sm-3 control-label"><?= __('Tiêu đề'); ?></label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.title', array( 'label' => false, 'div' => false, 'class' => 'form-control', 'placeholder' => 'Nhập tiêu đề' ) )?>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label"><?= __('Tên gọi khác'); ?></label>
					<div class="col-sm-5">
						<?php echo $this->Form->input($als.'.als', array( 'label' => false, 'div' => false, 'class' => 'form-control alias', 'placeholder' => 'ten-goi-khac' ) )?>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">Miêu tả</label>
					<div class="col-sm-9">
						<?php echo $this->Form->textarea($als.'.desc', array( 'label' => false, 'div' => false, 'class' => 'form-control tnmc', 'placeholder' => 'Nhập nội dung miêu tả' ) )?>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-3 control-label">Hình ảnh đại diện</label>
					<div class="col-sm-9">
						<?php if(!empty($this->data[$als]['image'])):?>
						<div class="row">
							<div class="col-sm-7 col-md-3">
								<div class="thumbnail">
									<?php echo $this->Form->hidden($als.'.image_old', array('value' => $this->data[$als]['image'] ) )?>
									<img src="<?= PUBLIC_THUMB_SHOW. $this->data[$als]['image'] ?>" alt="...">
								</div>
							</div>
						</div>
						<?php endif;?>

						<div class="row">
							<div class="col-sm-5"><input type="file" class="form-control" name="data[<?= $als ?>][image]"/></div>
						</div>
					</div>
				</div>

			</div>
			<div class="form-actions fluid">
				<div class="col-md-offset-3 col-md-9">
					<button type="submit" class="btn btn-success"><?= __('Lưu') ?></button>
					<a href="<?= $this->webroot.'admin/news' ?>" class="btn btn-default">Hủy bỏ</a>
				</div>
			</div>
		</div>
		<?php echo $this->Form->end( ); ?>
	</div><!-- End protet -->

</div>
